#!bin/sh

npm run build

tar -zcvf dist.tar.gz dist/

scp -r dist.tar.gz ubuntu@49.51.243.66:www/foreigntrade-admin

ssh ubuntu@49.51.243.66 << EOF

cd www/foreigntrade-admin

sudo rm -rf static      

sudo tar -zxvf dist.tar.gz --strip-components 1

sudo rm -rf dist.tar.gz

sudo nginx -s reload

exit
EOF

rm -rf dist.tar.gz

echo 上传完成！
